/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jse;

import java.io.*;

/**
 *
 * @author Swang
 */
public class CSVTest {
    public static void main(String[] args) throws IOException {
        File file = new File("C:/test.csv");
        if (!file.exists()) {
            file.createNewFile();
        }
        FileOutputStream fos = new FileOutputStream(file);
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos, "UTF-16LE"));
        byte b[] = {(byte)0xFF, (byte)0xFE};
   	bw.write(new String(b,"UTF-16LE"));

        StringBuilder header = new StringBuilder("标题1");
        header.append("\t").append("标题2");
        header.append("\t").append("标题3");
        bw.write(header.toString());
        bw.flush();
        bw.close();
    }
}
